one of them, and if you'd rather install examples the `--example` argument can
be used as well.
+As a special convenience, omitting the <crate> specification entirely will
+install the crate in the current directory. That is, `install` is equivalent to
+the more explicit `install --path .`.
+
The `--list` option will list all installed packages (and their versions).
";
SourceId::for_git(&url, gitref)
} else if let Some(path) = options.flag_path {
try!(SourceId::for_path(&config.cwd().join(path)))
+ } else if options.arg_crate == None {
+ try!(SourceId::for_path(&config.cwd()))
} else {
try!(SourceId::for_central(config))
};
.expect("path sources must have a valid path");
try!(select_pkg(PathSource::new(&path, source_id, config),
source_id, krate, vers,
- &mut |path| path.read_packages()))
+ &mut |path| path.read_packages())
+ .chain_error(|| human(format!("`{}` is not a crate root; specify a \
+ crate to install from crates.io, or \
+ use --path or --git to specify an \
+ alternate source", path.display()))))
} else {
try!(select_pkg(RegistrySource::new(source_id, config),
source_id, krate, vers,